var yuyue_index_ops = {
    init: function () {
        this.eventBind();
    },

    eventBind: function () {

        var title = document.getElementById('sec_title'); //左侧导航部分
        var title_list = title.getElementsByTagName('input');
        // alert(title_list[0].value);

        var len = title_list.length;

        for (var i = 0; i < len; i++) {

            title_list[i].index = i;

            title_list[i]['onclick'] = function () {
                var id = this.id;

                var data = {
                    id: id
                };

                $.ajax({
                    url: "/customer/yuyue/book",
                    type: 'POST',
                    data: data,
                    dataType: 'json',
                    success: function (res) {
                        var list = res.data.zuoye_info_list;
                        var div = "";

                        for (var i = 0; i < list.length; i++) {
                            div += " <div class=\"option\">\n" +
                                "                    <img src=\"" + list[i].main_image + "\" class=\"img-thumbnail\">\n" +
                                "                    <p>" + list[i].name + "</p>\n" +
                                "                    <p>￥：" + list[i].price + "</p>\n" +
                                "                </div>";
                        }

                        var sec_Content = document.getElementById("sec_Content")
                        sec_Content.innerHTML = div;
                    }
                });
            }
        }
    }
};

$(document).ready(function () {
    yuyue_index_ops.init();
});